import { getYqByWord } from '@/services/zhirong/dataIntegration';
import ProList from '@ant-design/pro-list';
import Paragraph from 'antd/lib/typography/Paragraph';

const YuqingList = ({ word }) => {
  return (
    <ProList
      style={{ padding: 0 }}
      split={true}
      request={getYqByWord}
      params={{ word }}
      metas={{
        title: {
          render: (_, row) => (
            <a
              href={row.title_link}
              target="_blank"
              rel="noreferrer"
              style={{ color: 'black', fontWeight: '400' }}
            >
              {row.tieba_name}
            </a>
          ),
        },
        subTitle: {
          dataIndex: 'fbtime',
        },
        description: {
          render: (_, row) => (
            <Paragraph ellipsis={3} style={{ marginTop: '0.5em' }}>
              {row.content}
            </Paragraph>
          ),
        },
      }}
      pagination={{
        defaultPageSize: 5,
        showSizeChanger: false,
      }}
      on
    />
  );
};

export default YuqingList;
